package com.thunisoft.design.chain;

import com.thunisoft.design.chain.impl.BmglyHandler;
import com.thunisoft.design.chain.impl.SzrHandler;
import com.thunisoft.design.chain.impl.XgldHandler;
import com.thunisoft.design.chain.impl.XxjssHandler;

/**
 * @title ChainMain.java
 * @package com.thunisoft.design.chain
 * @projectName spring.boot
 * @author yzj 
 * @date 2020年5月18日 上午10:38:28
 */
public class ChainMain {

	public static void main(String[] args) {
		Handler handler=new SzrHandler();
		handler.setNext(new BmglyHandler()).setNext(new XgldHandler()).setNext(new XxjssHandler());
		String szr="szr";
		String bmgly="bmgly";
		String xgld="xgld";
		String xxjss="xxjss";
		String other="other";
		System.out.println(handler.handleRequest(szr));
		System.out.println(handler.handleRequest(bmgly));
		System.out.println(handler.handleRequest(xgld));
		System.out.println(handler.handleRequest(xxjss));
		System.out.println(handler.handleRequest(other));
	}
}
